Scoping Constructs for Program Generators

نویسنده

  • Yannis Smaragdakis
چکیده

Program generation is the process of generating code in a high-level language (e.g., C, C++, Java) to implement an abstract specification of a program. Generated programs are created by synthesizing and composing code fragments. Binding identifiers in generated code with their correct variable declarations has been the focus of a lot of research work in the context of macro-expansion (e.g., hygienic macro expansion and syntactic closures mechanisms). The common solutions include automatically maintaining identifier environments, which determine the legal bindings for an identifier. In this paper we present generation scoping: an adaptation of hygienic macro-expansion techniques to general-purpose program generation. The conceptual novelty of generation scoping lies in making identifier environments first-class objects and organizing them explicitly into directed graphs. This approach yields significant benefits: We are able to express scoping relationships independently of the structure of the generated program. This way we get a stronger tool for detecting errors in the specification of generated code. Additionally, we are able to simplify the specification by employing powerful implicit qualification. Thus, generation scoping becomes a useful layer of infrastructure for implementing software generators: it both solves binding problems and makes code specification more convenient.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Scoping Constructs for Software Generators

A well-known problem in program generation is scoping. When identifiers (i.e., symbolic names) are used to refer to variables, types, or functions, program generators must ensure that generated identifiers are bound to their intended declarations. This is the standard scoping issue in programming languages, only automatically generated programs can quickly become too complex and maintaining bin...

متن کامل

Scoping Constructs in Logic Programming : Implementation Problems and their

This paper examines the implementation issues arising from introducing universally quantiied goals and some forms of implication goals in a logic programming language. While these constructs are useful in providing a logical approach to lexical scoping, they raise new implementation problems. Since universal and existential quantiiers may appear in mixed order in goals, the uniication operation...

متن کامل

Scoping Constructs in Logic Programming: Implementation Problems and Their Solution Scoping Constructs in Logic Programming: Implementation Problems and Their Solution

The inclusion of universal quanti cation and a form of implication in goals in logic programming is considered. These additions provide a logical basis for scoping but they also raise new implementation problems. When universal and existential quanti ers are permitted to appear in mixed order in goals, the devices of logic variables and uni cation that are employed in solving existential goals ...

متن کامل

Representing Objects in a Logic Programming Language With Scoping Constructs

We present a logic programming language that uses implications and universal quantifiers in goals and in the bodies of clauses to provide a simple scoping mechanism for program clauses and constants. Within this language it is possible to define a simple notion of parametric module and local constant. Given this ability to structure programs, we explore how object-oriented programming, where ob...

متن کامل

Representing Objects in a Logic Programming Langueage with Scoping Constructs

We present a logic programming language that uses implications and universal quantifiers in goals and in the bodies of clauses to provide a simple scoping mechanism for program clauses and constants. Within this language it is possible to define a simple notion of parametric module and local constant. Given this ability to structure programs, we explore how object-oriented programming, where ob...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1996